home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Hacks / [√] May be freely distributed / Keith Stattenfield / MacsbugWindow ƒ / MacsbugWindow.r < prev    next >
Encoding:
Text File  |  1994-06-25  |  3.6 KB  |  185 lines  |  [TEXT/KAHL]

  1. #include "SysTypes.r"
  2. #include "Types.r"
  3.  
  4. #include "MacsbugWindow.h"
  5.  
  6. resource 'vers' (1) {
  7.     0x02, 0x00, release, 0x00,
  8.     verUS,
  9.     "1.03",
  10.     "1.03, Copyright \251 Keith Stattenfield, MacHack 1994"
  11. };
  12.  
  13.  
  14. /* we use an MBAR resource to conveniently load all the menus */
  15.  
  16. resource 'MBAR' (rMenuBar, preload) {
  17.     { mApple, mFile, mEdit };    /* four menus */
  18. };
  19.  
  20.  
  21. resource 'MENU' (mApple, preload) {
  22.     mApple, textMenuProc,
  23.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  24.     enabled, apple,
  25.     {
  26.         "About Macsbug Window…",
  27.             noicon, nokey, nomark, plain;
  28.         "-",
  29.             noicon, nokey, nomark, plain
  30.     }
  31. };
  32.  
  33. resource 'MENU' (mFile, preload) {
  34.     mFile, textMenuProc,
  35.     MenuItem1,                /* enable Quit only, program enables others */
  36.     enabled, "File",
  37.     {
  38.         "Quit",
  39.             noicon, "Q", nomark, plain
  40.     }
  41. };
  42.  
  43. resource 'MENU' (mEdit, preload) {
  44.     mEdit, textMenuProc,
  45.     NoItems,                /* disable everything, program does the enabling */
  46.     enabled, "Edit",
  47.      {
  48.         "Undo",
  49.             noicon, "Z", nomark, plain;
  50.         "-",
  51.             noicon, nokey, nomark, plain;
  52.         "Cut",
  53.             noicon, "X", nomark, plain;
  54.         "Copy",
  55.             noicon, "C", nomark, plain;
  56.         "Paste",
  57.             noicon, "V", nomark, plain;
  58.         "Clear",
  59.             noicon, nokey, nomark, plain
  60.         "-",
  61.             noicon, nokey, nomark, plain;
  62.         "Update",
  63.             noicon, "U", nomark, plain;
  64.     }
  65. };
  66.  
  67. /* this ALRT and DITL are used as an About screen */
  68.  
  69. resource 'ALRT' (rAboutAlert, purgeable) {
  70.     {40, 20, 160, 297},
  71.     rAboutAlert,
  72.     { /* array: 4 elements */
  73.         /* [1] */
  74.         OK, visible, silent,
  75.         /* [2] */
  76.         OK, visible, silent,
  77.         /* [3] */
  78.         OK, visible, silent,
  79.         /* [4] */
  80.         OK, visible, silent
  81.     }
  82. };
  83.  
  84. resource 'DITL' (rAboutAlert, purgeable) {
  85.     { /* array DITLarray: 5 elements */
  86.         /* [1] */
  87.         {88, 185, 108, 265},
  88.         Button {
  89.             enabled,
  90.             "OK"
  91.         },
  92.         /* [2] */
  93.         {8, 8, 24, 214},
  94.         StaticText {
  95.             disabled,
  96.             "Simple Sample (Traffic Light)"
  97.         },
  98.         /* [3] */
  99.         {32, 8, 48, 296},
  100.         StaticText {
  101.             disabled,
  102.             "Copyright © Apple Computer 1989-1990"
  103.         },
  104.         /* [4] */
  105.         {56, 8, 72, 136},
  106.         StaticText {
  107.             disabled,
  108.             "Brought to you by:"
  109.         },
  110.         /* [5] */
  111.         {80, 24, 112, 167},
  112.         StaticText {
  113.             disabled,
  114.             "Macintosh Developer  Technical Support"
  115.         }
  116.     }
  117. };
  118.  
  119.  
  120. /* this ALRT and DITL are used as an error screen */
  121.  
  122. resource 'ALRT' (rUserAlert, purgeable) {
  123.     {40, 20, 120, 260},
  124.     rUserAlert,
  125.     { /* array: 4 elements */
  126.         /* [1] */
  127.         OK, visible, silent,
  128.         /* [2] */
  129.         OK, visible, silent,
  130.         /* [3] */
  131.         OK, visible, silent,
  132.         /* [4] */
  133.         OK, visible, silent
  134.     }
  135. };
  136.  
  137.  
  138. resource 'DITL' (rUserAlert, purgeable) {
  139.     { /* array DITLarray: 3 elements */
  140.         /* [1] */
  141.         {50, 150, 70, 230},
  142.         Button {
  143.             enabled,
  144.             "OK"
  145.         },
  146.         /* [2] */
  147.         {10, 60, 30, 230},
  148.         StaticText {
  149.             disabled,
  150.             "Sample - Error occurred!"
  151.         },
  152.         /* [3] */
  153.         {8, 8, 40, 40},
  154.         Icon {
  155.             disabled,
  156.             2
  157.         }
  158.     }
  159. };
  160.  
  161.  
  162. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  163.  
  164. resource 'SIZE' (-1) {
  165.     dontSaveScreen,
  166.     acceptSuspendResumeEvents,
  167.     enableOptionSwitch,
  168.     canBackground,                /* we can background; we don't currently, but our sleep value */
  169.                                 /* guarantees we don't hog the Mac while we are in the background */
  170.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  171.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  172.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  173.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  174.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  175.     reserved,
  176.     reserved,
  177.     reserved,
  178.     reserved,
  179.     reserved,
  180.     reserved,
  181.     reserved,
  182.     kPrefSize * 1024,
  183.     kMinSize * 1024    
  184. };
  185.